﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FreeSql.DataAnnotations;
using SqlSugar;

namespace TestORM1.Model
{
    [SugarTable("Blog")]//当和数据库名称不一样可以设置别名
    public class Blog
    {
        public Blog(){}

        public Blog(string title,int number)
        {
            this.Title = title;
            this.Number = number;
            this.CTime=DateTime.Now;
        }
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]//通过特性设置主键和自增列 
        [Column(IsIdentity = true, IsPrimary = true)]
        public int Id { get; set; }
        public string Title { get; set; }
        public int Number { get; set; }
        public DateTime CTime { get; set; }
    }
}
